<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%building_orders}}".
 *
 * @property int $id
 * @property string $title 标题
 * @property int $created_at
 * @property int $updated_at
 * @property int $status
 * @property int $deleted_at
 * @property int $province_id
 * @property int $city_id
 * @property int $county_id
 * @property string $address 详细地址
 * @property string $custom_name 客户名
 * @property string $custom_mobile 客户手机
 * @property int|null $created_by_admin
 * @property int|null $updated_by_admin
 */
class BuildingOrders extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%building_orders}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['title', 'created_at', 'updated_at', 'status', 'deleted_at', 'province_id', 'city_id', 'county_id', 'address', 'custom_name', 'custom_mobile', 'created_by_admin', 'updated_by_admin'], 'trim'],
            [['title', 'created_at', 'updated_at', 'province_id', 'city_id', 'county_id', 'address', 'custom_name', 'custom_mobile'], 'required'],
            [['created_at', 'updated_at', 'status', 'deleted_at', 'province_id', 'city_id', 'county_id', 'created_by_admin', 'updated_by_admin'], 'integer'],
            [['title', 'address', 'custom_name'], 'string', 'max' => 180],
            [['custom_mobile'], 'string', 'max' => 20],
            [['status'], 'default', 'value' => 1],
            [['deleted_at'], 'default', 'value' => 0],
            [['created_by_admin', 'updated_by_admin'], 'default', 'value' => null],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'title' => Yii::t('app', '标题'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'status' => Yii::t('app', 'Status'),
            'deleted_at' => Yii::t('app', 'Deleted At'),
            'province_id' => Yii::t('app', 'Province ID'),
            'city_id' => Yii::t('app', 'City ID'),
            'county_id' => Yii::t('app', 'County ID'),
            'address' => Yii::t('app', '详细地址'),
            'custom_name' => Yii::t('app', '客户名'),
            'custom_mobile' => Yii::t('app', '客户手机'),
            'created_by_admin' => Yii::t('app', 'Created By Admin'),
            'updated_by_admin' => Yii::t('app', 'Updated By Admin'),
        ];
    }
}
